home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Communications Toolbox / CommToolbox 1.1 / Interfaces / CIncludes / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  5.5 KB  |  197 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.     Dialogs.h
  3.     C Interface to the Macintosh Libraries
  4.  
  5.         Copyright Apple Computer, Inc.     1985-1991
  6.         All rights reserved
  7. ************************************************************/
  8.  
  9.  
  10. #ifndef __DIALOGS__
  11. #define __DIALOGS__
  12.  
  13. #ifndef __WINDOWS__
  14. #include <Windows.h>
  15. #endif
  16.  
  17. #ifndef __TEXTEDIT__
  18. #include <TextEdit.h>
  19. #endif
  20.  
  21.  
  22. enum {
  23.  
  24.     ctrlItem = 4,
  25.     btnCtrl = 0,
  26.     chkCtrl = 1,
  27.     radCtrl = 2,
  28.     resCtrl = 3,
  29.     statText = 8,
  30.     editText = 16,
  31.     iconItem = 32,
  32.     picItem = 64,
  33.     userItem = 0,
  34.     itemDisable = 128,
  35.     ok = 1,
  36.     cancel = 2,
  37.     stopIcon = 0,
  38.     noteIcon = 1,
  39.     cautionIcon = 2
  40. };
  41.  
  42. /*    Dialog Item List Manipulation Constants    */
  43. typedef short DITLMethod;
  44.  
  45. enum {
  46.  
  47.     overlayDITL = 0,
  48.     appendDITLRight = 1,
  49.     appendDITLBottom = 2
  50. };
  51.  
  52. typedef short StageList;
  53.  
  54.  
  55. typedef WindowPtr DialogPtr;
  56. typedef pascal void (*ResumeProcPtr)(void);
  57. typedef pascal void (*SoundProcPtr)(void);
  58. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  59.  
  60. struct DialogRecord {
  61.     WindowRecord window;
  62.     Handle items;
  63.     TEHandle textH;
  64.     short editField;
  65.     short editOpen;
  66.     short aDefItem;
  67. };
  68.  
  69. typedef struct DialogRecord DialogRecord;
  70. typedef DialogRecord *DialogPeek;
  71.  
  72. struct DialogTemplate {
  73.     Rect boundsRect;
  74.     short procID;
  75.     Boolean visible;
  76.     Boolean filler1;
  77.     Boolean goAwayFlag;
  78.     Boolean filler2;
  79.     long refCon;
  80.     short itemsID;
  81.     Str255 title;
  82. };
  83.  
  84. typedef struct DialogTemplate DialogTemplate;
  85. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  86.  
  87. struct AlertTemplate {
  88.     Rect boundsRect;
  89.     short itemsID;
  90.     StageList stages;
  91. };
  92.  
  93. typedef struct AlertTemplate AlertTemplate;
  94. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  95.  
  96.  
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100. pascal void InitDialogs(ResumeProcPtr resumeProc)
  101.     = 0xA97B; 
  102. pascal void ErrorSound(SoundProcPtr soundProc)
  103.     = 0xA98C; 
  104. pascal DialogPtr NewDialog(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  105.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  106.     Handle itmLstHndl)
  107.     = 0xA97D; 
  108. DialogPtr newdialog(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  109.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  110. pascal DialogPtr GetNewDialog(short dialogID,void *dStorage,WindowPtr behind)
  111.     = 0xA97C; 
  112. pascal void CloseDialog(DialogPtr theDialog)
  113.     = 0xA982; 
  114. pascal void DisposDialog(DialogPtr theDialog)
  115.     = 0xA983; 
  116. pascal void DisposeDialog(DialogPtr theDialog)
  117.     = 0xA983; 
  118. pascal void CouldDialog(short dialogID)
  119.     = 0xA979; 
  120. pascal void FreeDialog(short dialogID)
  121.     = 0xA97A; 
  122. pascal void ParamText(ConstStr255Param param0,ConstStr255Param param1,ConstStr255Param param2,
  123.     ConstStr255Param param3)
  124.     = 0xA98B; 
  125. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  126.     = 0xA991; 
  127. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  128.     = 0xA97F; 
  129. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  130.     short *itemHit)
  131.     = 0xA980; 
  132. pascal void DrawDialog(DialogPtr theDialog)
  133.     = 0xA981; 
  134. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  135.     = 0xA978; 
  136. pascal void UpdateDialog(DialogPtr theDialog,RgnHandle updateRgn)
  137.     = 0xA978; 
  138. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  139.     = 0xA985; 
  140. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  141.     = 0xA986; 
  142. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  143.     = 0xA987; 
  144. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  145.     = 0xA988; 
  146. pascal void CouldAlert(short alertID)
  147.     = 0xA989; 
  148. pascal void FreeAlert(short alertID)
  149.     = 0xA98A; 
  150. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  151.     Rect *box)
  152.     = 0xA98D; 
  153. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  154.     const Rect *box)
  155.     = 0xA98E; 
  156. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  157.     = 0xA827; 
  158. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  159.     = 0xA828; 
  160. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  161.     = 0xA97E; 
  162. pascal void GetIText(Handle item,Str255 text)
  163.     = 0xA990; 
  164. pascal void SetIText(Handle item,ConstStr255Param text)
  165.     = 0xA98F; 
  166. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  167.     = 0xA984; 
  168. pascal DialogPtr NewCDialog(void *dStorage,const Rect *boundsRect,ConstStr255Param title,
  169.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  170.     Handle items)
  171.     = 0xAA4B; 
  172. DialogPtr newcdialog(void *dStorage,const Rect *boundsRect,char *title,
  173.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  174.     Handle items); 
  175. #define GetAlrtStage() (* (short*) 0x0A9A)
  176. pascal void ResetAlrtStage(void)
  177.     = {0x4278,0x0A9A}; 
  178. pascal void DlgCut(DialogPtr theDialog); 
  179. pascal void DlgPaste(DialogPtr theDialog); 
  180. pascal void DlgCopy(DialogPtr theDialog); 
  181. pascal void DlgDelete(DialogPtr theDialog); 
  182. pascal void SetDAFont(short fontNum)
  183.     = {0x31DF,0x0AFA}; 
  184. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  185. void getitext(Handle item,char *text); 
  186. void setitext(Handle item,char *text); 
  187. short findditem(DialogPtr theDialog,Point *thePt); 
  188.  
  189. pascal void    AppendDITL(DialogPtr theDialog,Handle theHandle,DITLMethod method);
  190. pascal short CountDITL(DialogPtr theDialog);
  191. pascal void    ShortenDITL(DialogPtr theDialog,short numberItems);
  192. #ifdef __cplusplus
  193. }
  194. #endif
  195.  
  196. #endif
  197.